import { Navigate } from "react-router-dom";

// 高阶组件实现鉴权
export const RouterAuth = ({children})=>{
    const token = localStorage.getItem('token')
    
    if(!token){
        return <Navigate to='/login' replace />
    }
    return (
        children
    )
}